FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g4f198b2.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g4f198b2.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=4f198b2 OS_GIT_VERSION=4.10.0-202202160023.p0.g4f198b2.assembly.stream-4f198b2 SOURCE_DATE_EPOCH=1638540527 SOURCE_GIT_COMMIT=4f198b2bd5d141a561fbe6642de20b520d72e513 SOURCE_GIT_TAG=v0.3.1-282-g4f198b2b SOURCE_GIT_URL=https://github.com/openshift/kube-rbac-proxy 
WORKDIR /go/src/github.com/brancz/kube-rbac-proxy
COPY . .
ENV GO111MODULE=on
# GOFLAGS is needed to build image without accessing external sources, mostly to comply with ART policies
ENV GOFLAGS="-mod=vendor"
RUN make build && \
    cp _output/kube-rbac-proxy-$(go env GOOS)-$(go env GOARCH) _output/kube-rbac-proxy

FROM openshift/ose-base:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g4f198b2.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g4f198b2.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=4f198b2 OS_GIT_VERSION=4.10.0-202202160023.p0.g4f198b2.assembly.stream-4f198b2 SOURCE_DATE_EPOCH=1638540527 SOURCE_GIT_COMMIT=4f198b2bd5d141a561fbe6642de20b520d72e513 SOURCE_GIT_TAG=v0.3.1-282-g4f198b2b SOURCE_GIT_URL=https://github.com/openshift/kube-rbac-proxy 

ARG FROM_DIRECTORY=/go/src/github.com/brancz/kube-rbac-proxy
COPY --from=builder ${FROM_DIRECTORY}/_output/kube-rbac-proxy  /usr/bin/kube-rbac-proxy

USER 65534
EXPOSE 8080
ENTRYPOINT ["/usr/bin/kube-rbac-proxy"]

LABEL \
        io.k8s.display-name="kube-rbac-proxy" \
        io.k8s.description="This is a proxy, that can perform Kubernetes RBAC authorization." \
        io.openshift.tags="kubernetes" \
        summary="" \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        License="ASL 2.0" \
        vendor="Red Hat" \
        name="openshift/ose-kube-rbac-proxy" \
        com.redhat.component="kube-rbac-proxy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202202160023.p0.g4f198b2.assembly.stream" \
        io.openshift.build.commit.id="4f198b2bd5d141a561fbe6642de20b520d72e513" \
        io.openshift.build.source-location="https://github.com/openshift/kube-rbac-proxy" \
        io.openshift.build.commit.url="https://github.com/openshift/kube-rbac-proxy/commit/4f198b2bd5d141a561fbe6642de20b520d72e513" \
        version="v4.10.0"

